package cn.edu.jxau.core.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * Desc:
 * ------------------------------------
 * Author:fulei04@meituan.com
 * Date:2017/12/17
 * Time:下午3:11
 */
public class IOUtils {

    public static String getString(InputStream in) {

        StringBuilder builder = new StringBuilder();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String temp = null;
        try {
            while ((temp = reader.readLine()) != null) {
                builder.append(temp);
            }
            return builder.toString();
        } catch (IOException e) {
            throw new RuntimeException("输入流读取失败",e);
        }
    }
}
